\section{user\_\-handler::web\_\-acceptor Class Reference}
\label{classuser__handler_1_1web__acceptor}\index{user_handler::web_acceptor@{user\_\-handler::web\_\-acceptor}}
This class creates new \doxyref{web\_\-handler}{p.}{classuser__handler_1_1web__handler} if a new connection with a web-client is established.  


{\tt \#include $<$web\_\-acceptor.h$>$}

Inheritance diagram for user\_\-handler::web\_\-acceptor::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classuser__handler_1_1web__acceptor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{web\_\-acceptor} (boost::shared\_\-ptr$<$ \bf{network::i\_\-socket} $>$ sock, boost::shared\_\-ptr$<$ \bf{network::i\_\-socket} $>$ control, boost::shared\_\-ptr$<$ \bf{network::connection\_\-manager} $>$ mgr, boost::weak\_\-ptr$<$ \bf{handler::multicaster} $>$ mul, boost::shared\_\-ptr$<$ \bf{music::music\_\-system} $>$ music)
\begin{CompactList}\small\item\em \doxyref{web\_\-acceptor}{p.}{classuser__handler_1_1web__acceptor} creates a new web-acceptor \item\end{CompactList}\item 
virtual \bf{$\sim$web\_\-acceptor} ()\label{classuser__handler_1_1web__acceptor_8a3ea67669298fc8673bde4204a534f7}

\item 
virtual void \bf{handle\_\-event} (boost::shared\_\-ptr$<$ \bf{network::message} $>$ n)
\begin{CompactList}\small\item\em handle\_\-event handles events from the web-listener \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class creates new \doxyref{web\_\-handler}{p.}{classuser__handler_1_1web__handler} if a new connection with a web-client is established. 



Definition at line 41 of file web\_\-acceptor.h.

\subsection{Constructor \& Destructor Documentation}
\index{user_handler::web_acceptor@{user\_\-handler::web\_\-acceptor}!web_acceptor@{web\_\-acceptor}}
\index{web_acceptor@{web\_\-acceptor}!user_handler::web_acceptor@{user\_\-handler::web\_\-acceptor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}user\_\-handler::web\_\-acceptor::web\_\-acceptor (boost::shared\_\-ptr$<$ \bf{network::i\_\-socket} $>$ {\em sock}, boost::shared\_\-ptr$<$ \bf{network::i\_\-socket} $>$ {\em control}, boost::shared\_\-ptr$<$ \bf{network::connection\_\-manager} $>$ {\em mgr}, boost::weak\_\-ptr$<$ \bf{handler::multicaster} $>$ {\em mul}, boost::shared\_\-ptr$<$ \bf{music::music\_\-system} $>$ {\em music})\hspace{0.3cm}{\tt  [inline]}}\label{classuser__handler_1_1web__acceptor_d9387aa488dc158915e54a58f2726188}


\doxyref{web\_\-acceptor}{p.}{classuser__handler_1_1web__acceptor} creates a new web-acceptor 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sock}]is the socket to the web-listener \item[{\em control}]is the socket to the microcontroller \item[{\em mgr}]is a pointer to the connection\_\-manager \item[{\em mul}]is a pointer to the multicaster \item[{\em music}]is a pointer to the music-system \end{description}
\end{Desc}


Definition at line 52 of file web\_\-acceptor.h.

\begin{Code}\begin{verbatim}57                 :_sock(sock), _controller(control), _mgr(mgr), _multi(mul), 
58                         _music(music) {}
\end{verbatim}\end{Code}




\subsection{Member Function Documentation}
\index{user_handler::web_acceptor@{user\_\-handler::web\_\-acceptor}!handle_event@{handle\_\-event}}
\index{handle_event@{handle\_\-event}!user_handler::web_acceptor@{user\_\-handler::web\_\-acceptor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void user\_\-handler::web\_\-acceptor::handle\_\-event (boost::shared\_\-ptr$<$ \bf{network::message} $>$ {\em n})\hspace{0.3cm}{\tt  [virtual]}}\label{classuser__handler_1_1web__acceptor_66b8156cdc32aa74d84305aa652a74f1}


handle\_\-event handles events from the web-listener 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em n}]is the received message. \end{description}
\end{Desc}


Implements \bf{handler::event\_\-handler} \doxyref{p.}{classhandler_1_1event__handler_7ff75131a32fb17cf4addc4581344bff}.

Definition at line 3 of file web\_\-acceptor.cpp.

\begin{Code}\begin{verbatim}5 {
6         // creating the receiver and handler...
7         if(n->type == network::CONNECT) {
8                 boost::shared_ptr<user_handler::web_handler> han(
9                         user_handler::web_handler::create(n->new_sock, 
10                                 _controller, _music, _mgr));
11                 boost::shared_ptr<handler::multicaster> multi(_multi.lock());
12                 multi->add_handler(network::RECEIVE, n->new_sock, han);
13                 multi->add_handler(network::DELETE, n->new_sock, han);
14                 _mgr->add_recv(n->new_sock, 
15                         network::configurator::get_web_filetype());
16         }
17 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
user\_\-handler/web\_\-acceptor.h\item 
user\_\-handler/web\_\-acceptor.cpp\end{CompactItemize}
